/**
 * 
 */
package shared;

import java.util.Vector;

/**
 * @author Sefverl
 *
 */
public class TaskQueue 
{
	private Vector<TaskObject> tasks;
	private static TaskQueue queue;
	
	public TaskQueue()
	{
		tasks = new Vector<TaskObject>();
	}
	
	public static TaskQueue getInstance()
	{
		if(queue == null)
		{
			queue = new TaskQueue();
		}
		
		return queue;
	}
	
	public void pushTask(TaskObject o)
	{
		tasks.add(o);
	}
	
	public TaskObject popTask()
	{
		TaskObject obj = tasks.lastElement();
		tasks.removeElementAt(tasks.size()-1);
		return obj;
	}
	
	
}
